package com.fit.pages.user;

import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.fit.dao.contactPerson.ContactPersonDAO;
import com.fit.dao.user.UserDAO;
import com.fit.entities.User;
import com.fit.pages.Confirmation;

public class MoreInfo {
	@Property
	@Persist
	private User user;



	@Inject
	private ContactPersonDAO contactPersonDAO;

	@Inject
	private UserDAO userDAO;

	@InjectPage
	private Confirmation confirmation;

	Object onActivate(Long id) {
		user = userDAO.findByID(id);


		if (user == null) {
			confirmation.setError("Greska prilikom prikaza zapisa korisnika! ");
			return confirmation;
		}
		return null;
	}
}
